from django.shortcuts import render
from django.http.response import JsonResponse
from django.views import View
from .tasks import add, mul, xsum

# Create your views here.
class TaskView(View):
    def get(self, request):
        add.delay(1, 2)
        print("add-ok")
        return JsonResponse({"message": "ok"})

    def post(self, request):
        mul.delay(2, 2)
        print("mul-ok")
        return JsonResponse({"message": "ok"})